﻿using System.Collections.Generic;
namespace LeRenard.ScriptWars.Model.GridSystem
{
    /// <summary>
    /// Represents a 2d grid.
    /// </summary>
    public interface IGrid<TValue>
        where TValue : class
    {
        /// <summary>
        /// Gets the grid's size.
        /// </summary>
        GridSize Size { get; }

        /// <summary>
        /// Gets all cells on the grid.
        /// </summary>
        IEnumerable<IGridCell<TValue>> Cells { get; }

        /// <summary>
        /// Gets the amount of cells.
        /// </summary>
        int CellCount { get; }

        /// <summary>
        /// Gets the grid's layout.
        /// The first dimension is Y/rows/height,
        /// The second dimension is X/columns/width.
        /// </summary>
        IGridCell<TValue>[,] Layout { get; }

        /// <summary>
        /// Gets the position for a <see cref="GridCell"/> with a specific value.
        /// </summary>
        GridPosition GetPositionFor<TValue>(TValue value);        
    }
}
